# Maintainer: Bruno Pagani <archange@archlinux.org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>

pkgname=frescobaldi
pkgver=3.3.0
pkgrel=2
pkgdesc="A LilyPond sheet music text editor"
arch=(any)
url="https://www.frescobaldi.org/"
license=(GPL)
depends=(
  python python-pyqt5 python-pyqt5-webengine python-ly poppler
  python-poppler-qt5 python-qpageview qt5-base qt5-svg
)
makedepends=(python-{build,installer,wheel}
             python-setuptools)
optdepends=(
  'lilypond: music engraving'
  'python-pygame: MIDI input and playback'
  'python-pycups: printing to a CUPS server'
  'hyphen-lang: hyphenation patterns for desired languages'
)
source=(https://github.com/frescobaldi/frescobaldi/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('9fb90934fbc08f6c7df0a4d999e89a9a82fe9b4a0f21c0d40a1474e3ac7bc0d8')

prepare() {
  cd ${pkgname}-${pkgver}
  # Provided by hyphen-*
  rm -f frescobaldi_app/hyphdicts/hyph_*.dic
  rm -f frescobaldi_app/hyphdicts/README*
}

build() {
  cd ${pkgname}-${pkgver}
  python -m build -wn
}

package() {
  cd ${pkgname}-${pkgver}
  python -m installer -d "${pkgdir}" dist/*.whl
}
